<template>
	<view class="scroll-view_H">
		
		<popup-layer ref="popupRef" :direction="'left'">
			<view style="position:absolute;margin-left: 2%;margin-top:15rpx;" @tap="chaxunclose()">
				<image :src="srcfanhui" class="item-icon-sys" mode=""></image>
			</view>
			<view style="height: 93%;font-size: 30rpx;">
				<view class="box" style="text-align: center;">
					<view>筛选</view>
				</view>
				<view class="box">
					<view class="popupspan">单据编号:</view>
					<view class="popupinput"><input type="text" v-model="inputdjbh" placeholder="请输入单据编号" placeholder-class="inputff"/></view>
				</view>
				<view class="box">
					<view class="popupspan">单据名称:</view>
					<view class="popupinput"><input type="text" v-model="inputdjmc" placeholder="请输入单据名称" placeholder-class="inputff"/></view>
				</view>
				
			
			</view>
				<view class="box" style="border-bottom: 0px #bfbfbf solid;border-top: 1rpx #bfbfbf solid;padding-top: 5rpx;padding-bottom: 5rpx;">
					<view class="popupspan" style="width: 49.5%;text-align: center;border-right: 1px #bfbfbf solid;padding-left: 0rpx;font-size: 28rpx;" @tap="chaxunreset()">重置</view>
					<view class="popupinput" style="width: 49.5%;text-align: center;color: #6D8AF9;padding-right: 0rpx;" @tap="chaxunok()">确定</view>
				</view>
		        
				
		</popup-layer>
		<view class="newbuttonleft" :style="{display:disPValue}" @tap="sxchaxun()">
			<view style="float: left;font-size: 28rpx;color: #515159;margin-left: 15rpx;">单据总数:{{SumCount}}</view>
			
		</view>
		<view class="newbutton" :style="{display:disPValue}" @tap="sxchaxun()">
			<image :src="srcsys" class="item-icon-sys" style="float: left;" mode=""></image>
			<view style="float: left;font-size: 28rpx;color: #bfbfbf;"></view>
		</view>
		
		<!-- 当设置tab-width,指定每个tab宽度时,则不使用flex布局,改用水平滑动 -->
		<home-me-tabs v-model="tabIndex" :tabs="tabs" :fixed="true" ref="metabs" v-on:pChangeType="change"
			>
		</home-me-tabs>
		
		
		<mescroll-body style="margin-top: 100px;" ref="mescrollRef" @init="mescrollInit" @down="downCallback" :down="downOption" :up="upOption" @up="upCallback">
	<view class="" v-for="good in list" :key="good.id">
		<view class="Item">			
			
			<view class="item-link item-content">
				<view class="item-inner" @tap="isanDocument($event)" :data-id="good.Id" >
					<view class="item-text"
						style="height: 60rpx;line-height: 60rpx;border-bottom: 1px #E6E6E6 solid !important;">
						<view class="ispan" style="font-size:32rpx;width: 70%;font-weight: bold;">
						{{good.单据编码}}
						</view>			
					</view>
					<view class="item-text">
						<view class="ispan">
							<view class="ispan_span">单据总金额</view>
							<view class="ispan_value">{{good.单据总金额}}</view>
						</view>
						<view class="span">
							<view class="ispan_span">单据名称</view>
							<view class="ispan_value">{{good.单据名称}}</view>
						</view>
					</view>
					<view class="item-text">
						<view class="ispan">
							<view class="ispan_span">使用部门</view>
							<view class="ispan_value">{{good.使用部门}}</view>
						</view>
						<view class="span">
							<view class="ispan_span">使用人</view>
							<view class="ispan_value">{{good.使用人}}</view>
						</view>
					</view>
					<view class="item-text">
						<view class="ispan" style="width: 100%;">
							<view class="ispan_span" style="width: 20%;">申购单号</view>
							<view class="ispan_value">{{good.申购单号}}</view>
						</view>
						
					</view>
					<view class="item-text">
						<view class="ispan">
							<view class="ispan_span">处理方式</view>
							<view class="ispan_value"></view>
						</view>
						<view class="span">
							<view class="ispan_span">审批状态</view>
							<view class="ispan_value">{{good.审批状态}}</view>
							
						</view>
					</view>
					<view class="item-text">
						<view class="ispan" style="width: 93%;">
							<view class="ispan_span" style="width: 20%;">制单部门</view>
							<view class="ispan_value">{{good.制单部门}}</view>
						</view>
						
					</view>
					<view class="item-text">
						<view class="ispan">
							<view class="ispan_span">制单人</view>
							<view class="ispan_value">{{good.制单人}}</view>
						</view>
						<view class="span">
							<view class="ispan_span">制单日期</view>
							<view class="ispan_value">{{good.制单日期}}</view>
							
						</view>
					</view>
				</view>	
						
			</view>
			
			<view class="btg">				
				<view class="item-text">
			
					<view class="btnspan">
						<view @tap="isanDocument($event)" :data-id="good.Id"
							 class="button button-active"
							style="border-right: 1px #E6E6E6 solid !important;	">
							<image :src="srcpximg" class="item-icon-px" 
							style="float: left;top:4px;margin-left: 38%;
							width: 35upx;
							height: 35upx;
							margin-right: 5rpx;" mode=""></image>
							<view style="float: left;color:#6D8AF9;font-size: 32rpx;">
								拍照上传</view>
							</view>
					</view>
					
			
				</view>
			</view>
		</view>
	</view>
	</mescroll-body>
	
	<tki-tree ref="tkitree" :selectParent="selectParent" :multiple="multiple" :range="treelist" :foldAll="flod" rangeKey="Name" :title="title"
	 @confirm="treeConfirm" @cancel="treeCancel" ></tki-tree>
	</view>
</template>

<script>
	// 引入mescroll-mixins.js
	import MescrollBody from "@/components/mescroll-uni/mescroll-body.vue"
	import MescrollUni from "@/components/mescroll-uni/mescroll-uni.vue"
	import popupLayer from "@/components/popup-layer/popup-layer.vue";
	import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
	import MescrollMoreItemMixin from "@/components/mescroll-uni/mixins/mescroll-more-item.js";
	import tkiTree from '@/components/tki-tree-asset/tki-tree.vue';
	import homemetabs from "@/components/home-me-tabs/home-me-tabs.vue";
	var self;
	export default {
		mixins: [MescrollMixin], // 使用mixin
		components: {
			MescrollBody
			,
			MescrollUni
			,
			popupLayer
			,
			tkiTree,
			homemetabs,
		},
		data() {
			return {
				// 下拉刷新的配置(可选, 绝大部分情况无需配置)
				downOption: {
					auto:true,
					native: false,
					beforeEndDownScroll:1000,
					textInOffset:"下拉刷新",
					textOutOffset:"释放刷新",
					textLoading:"加载中..."
				},upOption:{
					auto:true, // 不自动加载
					 page: {
						num: 0, // 当前页码,默认1,回调之前会加1,即callback(page)会从1开始
					 	size: 10 // 每页数据的数量
					},
					noMoreSize: 4, //如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5
					empty:{
						tip: '~ 暂无数据 ~'
					},
					src: "../../static/images/totop.png",
					offset: 50,
					duration: 300,
					zIndex: 9990,
					right: 20,
					bottom: 120,
					safearea: false,
					width: 72,
					radius: "50%",
					left: null,
				},
				list:[],
				loginid:"",
				loginName: "",
				searchType:"",
				SumCount:"0",
				srcsys: "../../static/images/icon-sxuan.png",
				srcfanhui: "../../static/images/icon-fanhui-you.png",
				inputgjz:"",
				inputdjbh:"",
				inputdjmc:"",
				inputzcmc:"",
				inputzdbm:"请选择制单部门 >",
				inputzdr:"请选择制单人 >",
				inputclfs:"请选择处理方式 >",
				inputdjzt:"请选择单据状态 >",
				inputzclbid:"",
				inputzdbmid:"",
				inputzdrid:"",
				inputclfsid:"",
				inputdjztid:"",	
				treelist: [],
				multiple: false,
				selectParent: true,
				flod: false,
				title:"选择资产类别",
				selectvalue:"",
				showTreeValue:false,
				ShowQueryValue:false,
				srcpximg: "../../static/images/icon_SatrtPD.png",
				srcendimg: "../../static/images/icon_EndPD.png",
				tabs: [{
					name: '进行中',
					code: '',
					id: '',
					"count":0
				}, {
					name: '已结束',
					code: '',
					id: '',
					"count":0
				}],
				tabIndex: 0, // 当前tab的下标
				
				
			}
		},
		onBackPress(options) {
			if(this.showTreeValue==true){
				this.showTreeValue=false;
				this.$refs.tkitree._hide();
				return true;
			}else{
				if(this.ShowQueryValue==true){
					this.ShowQueryValue=false;
					this.$refs.popupRef.close();
					return true;
				}else{
					return false;
				}
			}			
		}, 
		onNavigationBarButtonTap(val) {
			//return;
			if(val.index==0){//搜索
				uni.navigateTo({
					url: '../stock/StockDocumentDetailSearch?Search=' + this.searchtext+"&Type=assetlist",
				});
				}
			if(val.index==1){
				
				   // 只允许通过相机扫码
				   uni.scanCode({
					onlyFromCamera: true,
					success: function(qrres) {
						var mymodel = JSON.parse(qrres.result);
						console.log(mymodel);
						uni.request({
							
							url:uni.getStorageSync("localurl")+'/Documents/Query_Document_List',
							data: {
								pageSize: 5,
								_r: "dde7a3ef-2a1a-4494-880f-7c4f56dd0f9e",
								pageIndex: 0,
							},
							success: (res) => {
								console.log(res);
								if (res.data.successed == true) {
									self.SumCount=res.data.total;
									var mydata = [];
									var newrows = JSON.parse(res.data.rows);
									for (var i = 0; i < newrows.length; i++) {
										var valueRows = newrows[i].toString().split(',');
										var datarow = {};
										for (var j = 0; j < res.data.columns.length; j++) {
											//alert(_data.columns[j].字段名)
											datarow[res.data.columns[j].字段名] = valueRows[j];
										}
										mydata.push(datarow);
										
									}
									console.log(1223);
									self.list =mydata;
									}
								},
								fail: () => {
										//  请求失败,隐藏加载状态
										this.mescroll.endErr()
									}
								})
							
					}
				   });
				   
			   }
		    },
		methods: {
			/*下拉刷新的回调, 有三种处理方式:*/
			downCallback() {
				this.list=[];
				this.mescroll.resetUpScroll();
			
			},
			
			/*下拉加载的回调*/
			upCallback(page) {
				self = this;
				
				const userDept = uni.getStorageSync("userDept");
				//console.log(userDept);
				let pageNum = page.num; // 页码, 默认从1开始
				let pageSize = page.size; // 页长, 默认每页10条
				//orgName
				//request_tool
				this.request_tool({
					url:'/console/app/v1/document/pageData',
					type:'POST',
					data:{
				 	"pageSize": page.size,
				 	"current": page.num,
					"createUser":self.loginid,
					"status":"preparing",
					"name":"资产入库单"
				 }
				}).then(res => {
				    console.log(res);
					if(res.data.code==2000){
						var mydata = [];
						self.SumCount=res.data.data.total;
						var newrows = res.data.data.records;
						for (var i = 0; i < newrows.length; i++) {	
							var row=newrows[i];
							var datarow = {
								"Id":row.id,
								"单据编码":row.code,
								"单据名称":row.name,
								"制单部门":userDept.orgName,
								"制单人":self.loginName,
								"制单日期":self.getstrdate(row.createTime),
								"单据总金额":row.other.amount,
								"申购单号":row.other.purchaseOrderCode,
								"使用部门":row.other.usingDept,
								"使用人":row.other.usingUser,
								"审批状态":row.other.auditStatus,
								
							};							
							mydata.push(datarow);
							
						}
						console.log((mydata));
						//this.productList = mydata;
						// 接口返回的当前页数据列表 (数组)
						let curPageData = mydata; 
						// 接口返回的当前页数据长度 (如列表有26个数据,当前页返回8个,则curPageLen=8)
						let curPageLen = mydata.length; 
						// 接口返回的总页数 (如列表有26个数据,每页10条,共3页; 则totalPage=3)
						let totalPage = res.data.data.total/page.size; 
						// 接口返回的总数据量(如列表有26个数据,每页10条,共3页; 则totalSize=26)
						let totalSize = res.data.data.total; 
						// 接口返回的是否有下一页 (true/false)
						let hasNext =false; 
						 //设置列表数据
						 //console.log(curPageData);
						 if(page.num == 1) this.list = []; //如果是第一页需手动置空列表
						 this.list = this.list.concat(curPageData); //追加新数据
						 
						 // 请求成功,隐藏加载状态
						 //方法一(推荐): 后台接口有返回列表的总页数 totalPage
						 this.mescroll.endByPage(curPageLen, totalPage); 
						 
						 // 如果数据较复杂,可等到渲染完成之后再隐藏下拉加载状态: 如
						 // 建议使用setTimeout,因为this.$nextTick某些情况某些机型不触发
						 setTimeout(()=>{
						 	this.mescroll.endSuccess(curPageLen)
						 },20)
					}else{
						uni.showToast({
							icon: 'none',
							title: '请求失败'+JSON.stringify(res.data)
						});
						//  请求失败,隐藏加载状态
						this.mescroll.endErr()
					}
					//self.sumCount_ZY=res.data.data.total;
					//uni.setStorageSync("IdexSumCount_ZY",res.data.data.total)
				}).catch(err => {
				  console.error(err);
				  uni.showToast({
				  	icon: 'none',
				  	title: '请求异常'+err
				  });
				  //  请求失败,隐藏加载状态
				  this.mescroll.endErr()
				});
				/*
				uni.request({												
					url:uni.getStorageSync("localurl")+'/Documents/Query_Document_List',
					data: {
						pageSize: pageSize,
						_r: "dde7a3ef-2a1a-4494-880f-7c4f56dd0f9e",
						pageIndex: pageNum-1,
							"Code":this.inputdjbh,
							"CreatorDepartmentId":this.inputzdbmid,
							"CreatedByUserId":this.inputzdrid,
							"DutyDepartmentId":this.inputglbmid,
							"BillHandleTypeId":this.inputclfsid,
							"BillStatusId":this.inputdjztid,
					},
					success: (res) => {
						console.log(res);
						if (res.data.successed == true) {
							var mydata = [];
							self.SumCount=res.data.total;
							var newrows = JSON.parse(res.data.rows);
							for (var i = 0; i < newrows.length; i++) {
								var valueRows = newrows[i].toString().split(',');
								var datarow = {};
								for (var j = 0; j < res.data.columns.length; j++) {
									//alert(_data.columns[j].字段名)
									datarow[res.data.columns[j].字段名] = valueRows[j];
								}
								mydata.push(datarow);
								
							}
							console.log((mydata));
							//this.productList = mydata;
							// 接口返回的当前页数据列表 (数组)
							let curPageData = mydata; 
							// 接口返回的当前页数据长度 (如列表有26个数据,当前页返回8个,则curPageLen=8)
							let curPageLen = mydata.length; 
							// 接口返回的总页数 (如列表有26个数据,每页10条,共3页; 则totalPage=3)
							let totalPage = res.data.total/page.size; 
							// 接口返回的总数据量(如列表有26个数据,每页10条,共3页; 则totalSize=26)
							let totalSize = res.data.total; 
							// 接口返回的是否有下一页 (true/false)
							let hasNext =false; 
							 //设置列表数据
							 //console.log(curPageData);
							 if(page.num == 1) this.list = []; //如果是第一页需手动置空列表
							 this.list = this.list.concat(curPageData); //追加新数据
							 
							 // 请求成功,隐藏加载状态
							 //方法一(推荐): 后台接口有返回列表的总页数 totalPage
							 this.mescroll.endByPage(curPageLen, totalPage); 
							 
							 // 如果数据较复杂,可等到渲染完成之后再隐藏下拉加载状态: 如
							 // 建议使用setTimeout,因为this.$nextTick某些情况某些机型不触发
							 setTimeout(()=>{
							 	this.mescroll.endSuccess(curPageLen)
							 },20)
						
														 
							}
						},
						fail: () => {
								//  请求失败,隐藏加载状态
								this.mescroll.endErr()
							}
						})
						*/
				// 此处仍可以继续写其他接口请求...
				// 调用其他方法...									
			},
			queryasset(){
				uni.request({
					url:uni.getStorageSync("localurl")+'/Documents/Query_Document_List',
					data: {
						pageSize: 5,
						_r: "dde7a3ef-2a1a-4494-880f-7c4f56dd0f9e",
						pageIndex: 0,
					},
					success: (res) => {
						console.log(res);
						if (res.data.successed == true) {
							//sumCount
							//self.list=res.data;
						}
					},
					fail: () => {
						//  请求失败,隐藏加载状态
						this.mescroll.endErr()
					}
				})
			},
			change() {
				//console.log("子页面调用");
				console.log(this.tabIndex);
			
			},
			isanDocument(e){
				uni.navigateTo({
					url: '../document/documentdetail?act=edit&document_id=' + e.currentTarget.dataset.id,
				});
			},
			sxchaxun(){
				this.ShowQueryValue=true;
				 this.$refs.popupRef.show();
			},
			chaxunclose(){
				this.ShowQueryValue=false;
				this.$refs.popupRef.close();
			},
			chaxunreset(){
				this.inputdjbh="";
				this.inputdjmc="";
				this.inputzcbm="";
				this.inputzcmc="";
				this.inputzdbm="请选择制单部门";
				this.inputzdr="请选择制单人";
				this.inputclfs="请选择处理方式";
				this.inputdjzt="请选择单据状态";
				this.inputzdbmid="";
				this.inputzdrid="";
				this.inputclfsid="";
				this.inputdjztid="";
				this.ShowQueryValue=false;
				this.$refs.popupRef.close();
				this.downCallback();
			},
				chaxunok(){
					this.ShowQueryValue=false;
					this.$refs.popupRef.close();
					this.downCallback();
				},
				focusshow(e){
					this.selectvalue=e.currentTarget.dataset.id;
					this.treelist=[];
					this.$refs.tkitree.oldtreeList="";
					this.$refs.tkitree.servalue="";
					
				},
				// 确定回调事件
				treeConfirm(e) {
					this.showTreeValue=false;
					if(this.selectvalue=="clfs"){
						this.inputclfs=e[0].Name;
						this.inputclfsid=e[0].Id;
					}
					
				},
				// 取消回调事件
				treeCancel(e) {
					this.showTreeValue=false;
					console.log(e)
				},	
				// 显示树形选择器
				showTree() {
					this.showTreeValue=true;
					this.$refs.tkitree._show();
				},
				
				
				loadglbmProfile(){
					self=this;
								
					uni.showNavigationBarLoading();
				
					self.request_tool({
						url:'/console/app/v1/operator/pageData',
						type:'POST',
						data:{"orgId":self.inputzdbmid,"current":0,"pageSize":100}
					}).then(res => {
							console.error(res);
							if(res!=undefined){
							if (res.data.code == 2000) {
								console.log(res.data.data);
								//self.treelist= res.data.data;
								let newtreelist=[];
								for(var i=0;i<res.data.data.records.length;i++){
									let resitem= res.data.data.records[i];
									let treeitem={
										id:resitem.id,
										label:resitem.userName,
										isEnabled:resitem.isEnabled,
										checked:false,
										children:[],
									};
									newtreelist.push(treeitem);
								}
								self.treelist=newtreelist;
								setTimeout(function () {
								  uni.hideNavigationBarLoading();
								}, 2000);
								this.$refs.tkitree.oldtreeList="";
								this.$refs.tkitree.servalue="";
								this.showTree();
								//this.model = res.data.model;
							}else{
								uni.showToast({
									icon: 'none',
									title: res.data.msg
								});							
							}
							}
							}).catch(err => {
					  console.error(err);
					  
					});
					
					
				},
				loadsybmProfile(){
					self=this;
					uni.showNavigationBarLoading();
					self.request_tool({
						url:'/console/app/v1/operator/pageData',
						type:'POST',
						data:{"orgId":self.inputsybmid,"current":0,"pageSize":100}
					}).then(res => {
							console.error(res);
							if(res!=undefined){
							if (res.data.code == 2000) {
								console.log(res.data.data);
								//self.treelist= res.data.data;
								let newtreelist=[];
								for(var i=0;i<res.data.data.records.length;i++){
									let resitem= res.data.data.records[i];
									let treeitem={
										id:resitem.id,
										label:resitem.userName,
										isEnabled:resitem.isEnabled,
										checked:false,
										children:[],
									};
									newtreelist.push(treeitem);
								}
								self.treelist=newtreelist;
								setTimeout(function () {
								  uni.hideNavigationBarLoading();
								}, 2000);
								this.$refs.tkitree.oldtreeList="";
								this.$refs.tkitree.servalue="";
								this.showTree();
								//this.model = res.data.model;
							}else{
								uni.showToast({
									icon: 'none',
									title: res.data.msg
								});							
							}
							}
							}).catch(err => {
					  console.error(err);
					  
					});
					
				},
				
				loadRouteHandler(){
					self=this;
					
					uni.showNavigationBarLoading();
					uni.request({
						url:uni.getStorageSync("localurl")+'/Common/TreeSelector', //仅为示例，并非真实接口地址。
						data: {
							_Type: "AmsRouteHandlers",
							_Root:"793212f5-f44e-4bfa-b46d-0f3bd67b03a9"
						},
						success: res2 => {
							
							if (res2.data.successed == true) {
								//console.log(res2.data.data);
								var _typelist=[];
								for(var i=0;i<res2.data.data.length;i++){
									var model=res2.data.data[i];								
									var child=[];
									var _type={};
									_type.Id=model.Id;
									_type.Name=model.Name;
									for(var j=0;j<model.children.length;j++){
										var model1=model.children[j];
										var child1=[];
										var _type1={};
										_type1.Id=model1.Id;
										_type1.Name=model1.Name;
										for(var s=0;s<model1.children.length;s++){
											var model2=model1.children[s];
											var child2=[];
											var _type2={};
											_type2.Id=model2.Id;
											_type2.Name=model2.Name;
											
											_type2.children=child2;
											child1.push(_type2);									
										}
										_type1.children=child1;
										child.push(_type1);
									}
									
									_type.children=child;
									_typelist.push(_type);
								}
								self.treelist= _typelist;
								setTimeout(function () {
								  uni.hideNavigationBarLoading();
								}, 1000);
								//this.model = res.data.model;
							}
						},
						fail: () => {
					
							uni.showToast({
								icon: 'none',
								title: '网络异常,请稍后重试'
							});
						}
					});
					
				},loadDictionary(){
					self=this;
					
					uni.showNavigationBarLoading();
					uni.request({
						url:uni.getStorageSync("localurl")+'/Common/TreeSelector', //仅为示例，并非真实接口地址。
						data: {
							_Type: "AmsDictionarys",
							_Root:"00000000-0000-0000-0000-000000000001"
						},
						success: res2 => {
							
							if (res2.data.successed == true) {
								//console.log(res2.data.data);
								var _typelist=[];
								for(var i=0;i<res2.data.data.length;i++){
									var model=res2.data.data[i];								
									var child=[];
									var _type={};
									_type.Id=model.Id;
									_type.Name=model.Name;
									for(var j=0;j<model.children.length;j++){
										var model1=model.children[j];
										var child1=[];
										var _type1={};
										_type1.Id=model1.Id;
										_type1.Name=model1.Name;
										for(var s=0;s<model1.children.length;s++){
											var model2=model1.children[s];
											var child2=[];
											var _type2={};
											_type2.Id=model2.Id;
											_type2.Name=model2.Name;
											
											_type2.children=child2;
											child1.push(_type2);									
										}
										_type1.children=child1;
										child.push(_type1);
									}
									
									_type.children=child;
									_typelist.push(_type);
								}
								self.treelist= _typelist;
								setTimeout(function () {
								  uni.hideNavigationBarLoading();
								}, 1000);
								//this.model = res.data.model;
							}
						},
						fail: () => {
					
							uni.showToast({
								icon: 'none',
								title: '网络异常,请稍后重试'
							});
						}
					});
					
				}
				,adddocument(){
					console.log(11111)
					uni.navigateTo({
						url: '../document/documentedit?act=create',
					});
				},
				getstrdate(value){
					if(value.length>10){
						return value.substring(0, 4)+"-"+value.substring(4, 6)+"-"+value.substring(6, 8);
					}else{
						return value;
					}
				}
				,
				request_tool(options){
				 // 在这里可以对请求头进行一些设置
				 let baseUrl = uni.getStorageSync("localurl"); 
				 let userInfo = uni.getStorageSync("userInfo");
				 if (userInfo) {
				 	options.data['userLevelCode'] =JSON.parse(userInfo).levelCode;
				 	options.data['loginUserId'] = JSON.parse(userInfo).id;
				 }
				 let userDept = uni.getStorageSync("userDept");
				 //console.log(userDept);
				 if (userDept) {
				 	options.data['loginUserDeptLevelCode'] = userDept.levelCode;
				 	options.data['loginUserDeptId'] = userDept.id;
				 }
				 let currentRole = uni.getStorageSync("userRoles");
				  //console.log(currentRole);
				 if (currentRole) {
				 	options.data['roleLevelCode'] = currentRole[0].levelCode;
				 	options.data['roleId'] = currentRole[0].id;
				 }
				 let userReadDeptIds = uni.getStorageSync("userReadDeptIds");
				 
				 if (userReadDeptIds) {
				 	options.data['deptIds'] =userReadDeptIds;
				 }
				 
				  options.header = {
				      'Content-Type':'application/json',
				      Authorization: uni.getStorageSync("authorization")
				 }
				console.log(options);
				    return new Promise((resolve, reject) => {
				        uni.request({
				            url: baseUrl + options.url || '',
				            method: options.type || 'POST',
				            data: options.data || {},
				            header: options.header || {}      
				        }).then(data => {
				            let [err, res] = data;        
				            resolve(res);
				        }).catch(error => {
				            reject(error)
				        })
				    });
				}
		},
		onLoad(options) {
			//首先将实例指针保存到全局变量 self 方便在异步请求中访问实例本身
			const userinfo = uni.getStorageSync("userInfo");
			console.log(JSON.parse(userinfo));
			this.loginid=JSON.parse(userinfo).id;
			this.loginName = JSON.parse(userinfo).userName;
			

			//this.queryasset();
		
		
		}
	}
</script>

<style lang="scss">
	
	.item-icon-sys {
			width: 40upx;
			height: 40upx;
		}
	.item-icon-px {
			width: 20upx;
			height: 20upx;
		}
		.newbutton {
	
			font-style: normal;
			height: 64rpx !important;
			line-height: 60rpx !important;
			z-index: 9990;
			width: 50rpx !important;
			box-sizing: border-box;
			margin-right: 10rpx;
			border: none !important;
			border-radius: 8rpx !important;
			font-size: 34rpx !important;
			position: absolute;
			right: 20rpx !important;
			color: #FFFFFF;
			text-align: center;
			top: 13px;
		}
		
		.newbuttonleft {
		
			font-style: normal;
			height: 64rpx !important;
			line-height: 60rpx !important;
			z-index: 9990;
			width: 450rpx !important;
			box-sizing: border-box;
			margin-right: 10rpx;
			border: none !important;
			border-radius: 8rpx !important;
			font-size: 34rpx !important;
			position: absolute;
			left: 20rpx !important;
			color: #515159;
			text-align: center;
			top: 13px;
			
		}
	
		.content {
			background-color: #edf1f4;
		}
	
		.box {
			width: 600rpx;
			border-bottom: 1px #CCCCCC solid;
			height: 80rpx;
			line-height: 80rpx;
			z-index: 9999;
		}
	
		.box .popupspan {
			width: 36.5%;
			display: inline-block;
			height: 80rpx;
			line-height: 80rpx;
			padding-left: 3.5%;
			color: #5a5a5a;
		}
	
		.box .popupinput {
			width: 52%;
			text-align: right;
			display: inline-block;
			height: 80rpx;
			line-height: 80rpx;
			padding-right: 30rpx;
			float: right;
		}
	
		.box .popupinput input {
			height: 100%;
			line-height: 100%;
			font-size: 30rpx;
		}
	
		.inputff {
			color: #BEBEBE;
			font-size: 30rpx;
			white-space: nowrap;
			overflow: hidden;
			text-overflow: ellipsis;
		}
	
		.box .popupinput {
			font-size: 30rpx;
		}
	.item-icon-sys {
		width: 40upx;
		height: 40upx;
	}
	.item-icon-px{
		width: 40upx;
		height: 40upx;
	}

	mescroll-body {
		background-color: #edf1f4;

	}

	.content {
		background-color: #edf1f4;
		margin-top: 200rpx;
	}

	.fixed {
		width: 100%;
		text-align: center;
	}

	.list {
		line-height: 100px;
		border: 1px red solid;
		height: 580px;
	}

	/* 搜索框 */
	.search-ico,
	.search-ico-1 {
		width: 40upx;
		height: 40upx;
	}

	.item-ico {
		width: 120upx;
		height: 120upx;
	}

	.search-text {
		font-size: 14px;
		background-color: #FFFFFF;
		height: 80upx;
		width: 600upx;
		margin-left: 10upx;
	}

	.search-block {
		display: flex;
		flex-direction: row;
		padding-left: 10upx;
		position: relative;

	}

	.search-ico-wapper {
		background-color: #FFFFFF;
		display: flex;
		flex-direction: column;
		justify-content: center;
		padding: 0upx 0upx 0upx 40upx;
		border-bottom-left-radius: 18px;
		border-top-left-radius: 18px;
	}

	.search-ico-wapper1 {
		background-color: #FFFFFF;
		display: flex;
		flex-direction: column;
		justify-content: center;
		padding: 0upx 40upx 0upx 0upx;
		border-bottom-right-radius: 18px;
		border-top-right-radius: 18px;
	}

	.Item {
		overflow: hidden;
		border-radius: 16rpx;
		background: #fff;
		width: 100%;
		margin-bottom: 20rpx;
		margin-top: 20rpx;
	}

	.ItemIcon {
		float: left;
		margin-left: 10rpx;
		height: 230rpx;
	}

	.item-text .span {
		display: inline-block;
		width: 50%;
		float: right;
		font-size: 27rpx;
	}

	.item-text .ispan {
		font-style: normal;
		width: 50%;
		display: inline-block;
		font-size: 27rpx;
	}

	.item-text .ispan_span {
		color: #9E9CA5;
		float: left;
		width: 40%;
	}

	.item-text .ispan_value {
		float: left;
		font-size: 30rpx;
	}
	.item-text .ispan_rwvalue {
		height: 65rpx;
		width: 50%;
	}
	

	.btg {
		padding-top: 0rpx;
		
		border-top: 0px #E6E6E6 solid;
		padding-bottom: 0rpx;
		height: 100rpx;

	}



	.btg .item-text .ispan {
		font-style: normal;
		width: 24%;
		display: inline-block;
		font-size: 25rpx;
		line-height: 0rpx;
	}

	.btg .item-text .btnspan {
		font-style: normal;
		width: 100%;
		color:#6D8AF9;
		display: inline-block;
		line-height: 50rpx;
		height: 60rpx;
		float: left;
		padding: 10rpx 0;
		font-size: 32rpx;
	}

	.btg .item-text .tuspan {
		font-style: normal;
		display: inline-block;
		font-size: 25rpx;
		line-height: 40rpx;
		width: 100%;
		text-align: center;
		padding: 0 10rpx;
		margin-right: 10rpx;
		border-radius: 8rpx;
		color: #9E9CA5;
	}

	.btg .item-text .tuspanvalue {
		font-style: normal;
		display: inline-block;
		font-size: 30rpx;
		font-weight: bold;
		line-height: 50rpx;
		width: 100%;
		text-align: center;
		padding: 0 10rpx;
		margin-right: 10rpx;
		border-radius: 8rpx;
	}

	.btg .item-text .span {
		font-style: normal;
		width: 24%;
		display: inline-block;
		font-size: 25rpx;
		line-height: 50rpx;

	}

	.button {
		width: 100%;
		box-sizing: border-box;
		margin-right: 10rpx;
		border: 0px #000000 solid !important;
		font-size: 27rpx;
		line-height: 50rpx;
		height: 50rpx;
		text-align: center;
		padding: .10rpx 0;
		color: #6D8BCF !important;
		background-color: #ffffff !important;
		float: right;
	}



	.item-content {
		padding-left: 0;
	}

	.item-title .ispan {
		font-size: 27rpx;
		width: auto;
		height: auto;
	}

	.item-title {
		font-size: 40rpx;
		color: #454545;
		width: 100%;
		padding-left: .5rem;
	}

	.item-title-row {
		background-image: none;
		padding-right: 0px;
	}

	.item-link .item-inner {
		padding-right: 0;
		padding-left: .5rem;
		border-bottom: 1rpx #E6E6E6 solid;
	}


	.page-content {
		padding-top: 0;

	}

	.item-text {
		font-size: 27rpx;
		color: #454545;
		margin: 20rpx 0;
		padding-left: 20rpx;
		line-height: 1.2;
	}

	.btg .item-text {
		margin: 5rpx 0;
	}

	.btext {
		font-weight: normal;
		color: #F79D63;
	}

	.newqypd {
		font-size: 26rpx;
		width: 25% !important;
		color: #6D8AF9;
		text-align: center;
		margin-right: 0%;


	}

	.newqypdview {
		font-size: 26rpx;
		width: 70% !important;
		background-color: #E7F1FF;text-align: center;
								border-radius: 10rpx;
								color:#6D8AF9;height: 50rpx;line-height: 50rpx;
	}

	.scroll-view_H {
		white-space: nowrap;
		padding-top: 10rpx;
background-color: #edf1f4;
		transition:all 0.2s linear transform:translated3d(0, 0, 0) .scroll-view-item_H {
			display: inline-block;
			width: 100%;
			height: 100px;
		}

		.uni-bg-red {
			background: red;
		}

		.uni-bg-green {
			background: green;
		}

		.uni-bg-blue {
			background: blue;
		}


	}
	
	
</style>
